<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="../layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../layuiadmin/style/admin.css" media="all">
    <link rel="stylesheet" href="../layuiadmin/style/wu.css" media="all">
    <link rel="stylesheet" href="../layuiadmin/style/template.css" media="all">
    <title></title>
    <style>
        .layui-laydate-range {
            width: 547px !important;
        }
    </style>
</head>

<body>
    <div class="layui-fluid">
        <form class="layui-card layui-form" style="padding: 10px;">
            <div class="layui-form-item">
                <label class="layui-form-label">部门领导</label>
                <div class="layui-input-block">
                    <input type="text" name="teach" disabled placeholder="请输入姓名" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">部门名称</label>
                <div class="layui-input-block">
                    <select name="departments" cr-monitor="departments" lay-search lay-filter="departments" cr-title="部门名称" cr-value="部门名称" cr-api="Common/GetDepartments" class="layui-select">
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">文件下载</label>
                <div class="layui-input-block">
                    <input type="checkbox" name="isDownload" lay-skin="switch">
                </div>
            </div>
        </form>
    </div>
</body>
<script src="../js/tool/sweetalert.js"></script>
<script src="../layuiadmin/layui/layui.min.js"></script>
<script>
    var $ = '';
    function init(data) {
        layui.config({
            base: '../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['form', 'crSelect', 'index'], function () {
            var form = layui.form, crSelect = layui.crSelect;
            $ = layui.$;

            $("input[name=teach]").val(data.XM);
            data.SFXZ == "是" ? $("input[name=isDownload]").attr("checked", true) : "";
            form.render();

            crSelect({
                base: "../../",
                monitor: "departments",
                success: function () {
                    $("select[name=departments]").val(data.BMMC);
                    form.render("select");
                }
            })
        });
    }

    function getResult() {
        return {
            BMMC: $("select[name=departments]").val(),
            SFXZ: $("input[name=isDownload]:checked").val() ? "是" : "否"
        }
    }
</script>

</html>